precision lowp float;

varying vec2 vUv;//将顶点着色器变量传至片元着色器
varying float vElevation;

attribute vec3 position;
attribute vec2 uv;

uniform mat4 modelMatrix;
uniform mat4 viewMatrix;
uniform mat4 projectionMatrix;

uniform float uTime;

void main() {
    vUv = uv;
    vec4 modelPositon = modelMatrix * vec4(position, 1.0);

    //z坐标随x,y波动,类似波浪
    modelPositon.z += sin(modelPositon.x * 10.0 + 5.0 * uTime) * 0.1;//-5~5/-0.1~0.1
    modelPositon.z += sin(modelPositon.y * 10.0 + 5.0 * uTime) * 0.1;
    vElevation = modelPositon.z;//-0.2~0.2

    gl_Position = projectionMatrix * viewMatrix * modelPositon;
}